#ifndef HOSYNTAXHIGHLIGHTER_H
#define HOSYNTAXHIGHLIGHTER_H

#include <QSyntaxHighlighter>
#include <QTextCharFormat>
#include <QRegularExpression>

class HoSyntaxHighlighter : public QSyntaxHighlighter {
    Q_OBJECT

public:
    explicit HoSyntaxHighlighter(QStringList keywordPatterns, QTextDocument *parent = nullptr);

protected:
    void extracted(const QString &text);
    void highlightBlock(const QString &text) override;

private:
    struct HighlightingRule {
        QRegularExpression pattern;
        QTextCharFormat format;
    };
    QVector<HighlightingRule> highlightingRules;
};

#endif // HOSYNTAXHIGHLIGHTER_H
